import java.util.Arrays;

public class Merge_Arrays {
    public void merge(int[] nums1, int m, int[] nums2, int n) {
        for (int i = 0; i != n; ++i) {
            nums1[m + i] = nums2[i];
        }
        Arrays.sort(nums1);
    }

    public static void main(String[] args) {
        int[] num1 = {1,2,3,0,0,0};
        int[] num2 = {2,5,6};
        Merge_Arrays merge_arrays = new Merge_Arrays();
        merge_arrays.merge(num1,3,num2,3);
        System.out.println(Arrays.toString(num1));

    }
}
